<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="/static/blog.css" type="text/css" />
<title>{{ title }}</title>
<link rel="alternate" type="application/rss+xml" title="Bluemask Blog RSS Feed" href="http://bluemask.net/rss/" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
{% block header %}{% endblock %}
</head>

<body>
<div id="wrapper">
	<div id="header">
		<h1><a href='/'>Blue Mask</a></h1>
		<div id="toplinks">
			{% if not user.authenticated %}
			<a href="/admin/signin/">登录</a>{% else %}
			<strong>{{ user.username|title }}</strong> 已登录 |
			<a href="/admin/posts/draft/">写新文章</a> |
			<a href="/admin/posts/">管理</a> |  
			<a href="/admin/signout/">注销</a>
			{% endif %}
		</div>
	</div>
	<div class='clear'></div>
	<div class='navbottom'>
		{% block topnav %}bluemask.net{% endblock %}
	</div>
	<div class='page'>
		<div class='rightsidebar'>
			{% if latest_posts %}
			<h3>近期发布 <a href='/rss/' target='_blank'><img src='/static/images/feed.gif' border='0' /></a></h3>
			<ul>
				{% for p in latest_posts -%}
				<li><span class='arrow'>&raquo;</span><a href='/p/{{ p.id }}/' class='post-link'>{{ p.subject }}</a> {{ p.userlabel }}</li>
				{%- endfor %}
				<li><a href='/list/' class='post-link more'>... more &rsaquo;</a></li>
			</ul>
			{% endif %}
			
			{% if latest_comments %}
			<h3>最新评论</h3>
			<ul>
				{% for c in latest_comments -%}
				<li>{{ c.author }}: <a href='/p/{{ c.postid }}/#comments' class='comment-link'>{{ c.content|truncate(length=15, killwords=True, end='...') }}</a></li>
				{%- endfor %}
				<li><a href='/comments/' class='post-link more'>... more &rsaquo;</a></li>
			</ul>
			{% endif %}
			
			{% if links %}
			<h3>链接</h3>
			<ul>
				{% for link in links -%}
				<li><a href='{{ link.url }}' class='link' target='_blank'>{{ link.label }}</a></li>
				{%- endfor %}
			</ul>
			{% endif %}
			
			<h3>查找</h3>
			<div>
				<form method='GET' action='/search/'>
				<input type='text' name='q' size='15'/><input type='submit' value='Go'/>
				</form>
			</div>
			
			<h3>成员</h3>
			<ul>
				<li><a href='/users/' class='more'>浏览 ...</a></li>
			</ul>
			
			{% block sidebar %}{% endblock %}
			
		</div>		
		<div id="content">
		{% block main %}{% endblock %}
		</div>
		<div class='clear'></div>
	</div>
	<div id="footer">
		<p>
		COPYRIGHT&COPY;2011 BLUEMASK.NET<br />
		Powered by BluemaskBlog v0.1 (Python/Bottle/sqlite3)
		</p>
	</div>
</div>
</body>
</html>
